package
{
	import org.flixel.*;

	public class Skill extends FlxSprite		
	{		
		private var imgSkill:Class = null;
		private var skillType:int = 0;
		
		public function Skill(X:int,Y:int,t:int)
		{
			super(X,Y);	
			
			this.skillType = t;
			
			imgSkill = this.getSkillTypeClass(t);

			loadGraphic(imgSkill,false);	
			
			
		}
		
		//Basic game loop is BACK y'all
		override public function update():void
		{
			velocity.y = 80;
			
			super.update();
			
			//stop at the floor
			if(y < FlxG.height - 10 ){
				velocity.y = 0;
			}
		}
		
		public function getSkillType():int 
		{
			return skillType;	
		}
		
		public function getSkillTypeClass(skillType:int):Class 
		{
			if(skillType == 0){
				return Resources.IbmLogo;
			}
			if(skillType == 1){
				return Resources.OracleLogo;
			}
			if(skillType == 2){
				return Resources.GoogleLogo;
			}
			
			return Resources.IbmLogo		
		}
	}
}